<?php 
namespace CLUB\Controller;
use Think\Controller;
Vendor('hdphp.autoload');
Vendor('hdphp\houdunwang\crypt.Crypt');
/**
* 
*/
class PubController extends Controller
{
	/**
	 * 文件处理
	 * @param  [type] $filename [description]
	 * @param  [type] $savepath [description]
	 * @return [type]           [description]
	 */
	public function uploadfile($filename,$savepath){
		$temp = explode(".",$filename['name']);
		$ext = end($temp);
		$savename = rand(0,99).time().".".$ext;
		move_uploaded_file($filename['tmp_name'],$savepath.$savename);
		return $savename;
		exit;
	}
	public function HdEncrypt($EncryptData){
		$Hd =  \houdunwang\crypt\Crypt::encrypt($EncryptData);
	    return $Hd;
	}
	public function Thumbnail($filepath,$savename){
		$image = new \Think\Image();
		$image->open($filepath.$savename);
		// 缩略图400*500
		$image->thumb(200,200)->save($filepath.$savename); 
		//echo "ok";
		
	}
}